Skip to main content

Execute Reader

AutomatR.OracleDB.Database.ExecuteReader

The "Execute Reader" activity in AutomatR is designed to execute a SQL query on an Oracle database and retrieve the query result as a DataTable. This activity is useful when you need to fetch data from the database for further processing in your workflow.

Properties

NameDescription
Input
ConnectionSpecifies the OracleConnection variable representing the database connection on which the SQL query will be executed. This variable should be obtained from a previous "Connect" activity or a similar source.
Command TextSpecifies the SQL query to be executed. This query retrieves data from the Oracle database. String variables containing the SQL command text.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Execute Reader" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Ex.: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.
Command TimeoutSpecifies the amount of time (in milliseconds) to wait for the SQL command to run before throwing an error. If not provided, the default timeout is set to 300 seconds. Integer variables containing the command timeout duration.
Output
ResultOutputs the result of the SQL query as a DataTable variable. The DataTable variable can be used in subsequent activities or operations within the workflow.

How to use:

  1. Drag and drop the "Execute Reader" activity onto the workflow.
  2. Configure the properties by specifying the OracleConnection variable obtained from a previous "Connect" activity, the SQL query text, and other optional parameters.
  3. Optionally, configure the delay.
  4. Execute the workflow to execute the SQL query and retrieve the result as a DataTable.

Note:

  • Ensure that the SQL query provided is a valid SELECT statement.
  • The result is stored in a DataTable variable, allowing you to manipulate and use the tabular data in subsequent activities.

Example: Consider an example where the "Execute Reader" activity is used to fetch employee data from an Oracle database:

Execute Reader:
Connection: oracleConnectionVariable
Command Text: "SELECT * FROM Employees"
Command Timeout: 5000
Result: employeeData

In this example, the activity is configured to execute a SELECT query on the "Employees" table, and the result is stored in the DataTable variable "employeeData" for further use in the workflow.